/**
 * 
 */
package org.cuatrovientos.rollthedice;

import java.util.Random;

/**
 * Represents a Dice
 * @author carlos_ruiz
 *
 */
public class Dice {
	// attributes //always private
	private int sides;
	
	/**
	 * constructor whit sides
	 */
	// constructor
	public Dice () {
		sides = 6;
	}
	
	public Dice (int sides) {
		this.sides = sides;
	}
	
	/**
	 * rolls the dice
	 * @return value
	 */
	// methods
	public int roll () {
		Random random = new Random();
		return random.nextInt(sides)+1;
	}

	/**
	 * @return the sides
	 */
	public int getSides() {
		return sides;
	}

	/**
	 * @param sides the sides to set
	 */
	public void setSides(int sides) {
		this.sides = sides;
	}
	
	
	
}
